package cn.didi.feidi.androidorder.db;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import cn.didi.feidi.androidorder.model.ShoppingCar;
import cn.didi.feidi.androidorder.model.UserAddress;
import cn.didi.feidi.androidorder.model.WaterBucket;

import cn.didi.feidi.androidorder.db.ShoppingCarDao;
import cn.didi.feidi.androidorder.db.UserAddressDao;
import cn.didi.feidi.androidorder.db.WaterBucketDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig shoppingCarDaoConfig;
    private final DaoConfig userAddressDaoConfig;
    private final DaoConfig waterBucketDaoConfig;

    private final ShoppingCarDao shoppingCarDao;
    private final UserAddressDao userAddressDao;
    private final WaterBucketDao waterBucketDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        shoppingCarDaoConfig = daoConfigMap.get(ShoppingCarDao.class).clone();
        shoppingCarDaoConfig.initIdentityScope(type);

        userAddressDaoConfig = daoConfigMap.get(UserAddressDao.class).clone();
        userAddressDaoConfig.initIdentityScope(type);

        waterBucketDaoConfig = daoConfigMap.get(WaterBucketDao.class).clone();
        waterBucketDaoConfig.initIdentityScope(type);

        shoppingCarDao = new ShoppingCarDao(shoppingCarDaoConfig, this);
        userAddressDao = new UserAddressDao(userAddressDaoConfig, this);
        waterBucketDao = new WaterBucketDao(waterBucketDaoConfig, this);

        registerDao(ShoppingCar.class, shoppingCarDao);
        registerDao(UserAddress.class, userAddressDao);
        registerDao(WaterBucket.class, waterBucketDao);
    }
    
    public void clear() {
        shoppingCarDaoConfig.clearIdentityScope();
        userAddressDaoConfig.clearIdentityScope();
        waterBucketDaoConfig.clearIdentityScope();
    }

    public ShoppingCarDao getShoppingCarDao() {
        return shoppingCarDao;
    }

    public UserAddressDao getUserAddressDao() {
        return userAddressDao;
    }

    public WaterBucketDao getWaterBucketDao() {
        return waterBucketDao;
    }

}
